Skip to content

PR-FLOW-01: PowerShell command labels over ogar-loco (ogar-flow-m365) - #368

Merged
AdaWorldAPI merged 3 commits into
mainfrom
ccr-7a4f3a52-1mvica
Nov 4, 2026
Merged

AdaWorldAPI merged 3 commits into
mainfrom
ccr-7a4f3a52-1mvica

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

A new sibling crate, ogar-flow-m365. It maps PowerShell-style admin labels (Get-MgUser, Get-IamLicenseEvidence, Get-IamMembership, Where-Object, Select-Object, Export-Report, plus aliases) to typed operations. An admitted read-only pipeline subset is lowered into one ogar-loco Quads body, which the unchanged ogar_loco::Interpreter runs under a flow Dialect.

Get-MgUser -UserId "john.doe@example.test" | Get-IamLicenseEvidence |
    Select-Object DisplayName, Department, Licenses | Export-Report -Format JSON

This compiles to calls 0x90 0x91 0x94 0x95. Run against the synthetic fixture, it produces a deterministic JSON report containing the requested user, the three permitted fields, the license facts, the source id, the observed version, the applied scope, the policy version and a per-stage trace.

Litmus test

Get-MgUser was added without touching ogar-loco: git diff origin/main -- crates/ogar-loco is empty. There are no new opcodes and no changes to the ABI, the interpreter, the conformance rules or DOMAIN_FLOOR.

Design

  • Adjacency table (adjacency.rs): label → OperationId → Operation. Each operation records its effect, capability, input/output shape, backend, call byte and concept binding. Aliases point at the same operation row. Mutating labels (Set-MgUser, Remove-MgUser, New-MgGroupMember, Set-MgUserLicense) and executing labels (Invoke-Expression/iex) are known but have no call byte, so they are refused. Unknown labels are refused.
  • Vocabulary (vocab.rs): six domain bytes 0x90..=0x95. It passes ogar-loco conformance. Where-Object uses the shared-core EQ/NEQ/LIST_CONTAINS bytes as its comparison codebook. Select-Object packs a lance_graph_contract::class_view::FieldMask.
  • Trust order: run_flow accepts only an ogar_auth::federation::VerifiedLogin. A ReportAuthority maps the canonical user to a ReportScope (tenant, capabilities, field mask, policy version) before anything runs. Host queries carry the scope's tenant, never one named in the pipeline. Filtering or selecting an unpermitted field is refused.

Implemented / mocked / deferred

  • Implemented: adjacency, vocabulary, lowering, execution through the LOCO interpreter, the verified-login entry, the deterministic report.
  • Mocked (behind the fixture feature, not security): directory observations, the report authority, the assertion verifier. The verifier still goes through the real establish.
  • Deferred, gated: production RBAC via OgarRbac and registering the vocabulary under a body classid. Both need concept ids that ogar-vocab does not mint today: directory user, license assignment, group membership, report. That is an operator decision; this PR mints nothing.

Tests

cargo test -p ogar-flow-m365: 29 passed. These are falsifiers F1–F10 on synthetic data.

  • The baseline ogar-loco suite has 84 passed, both before and after this change.
  • cargo clippy -p ogar-flow-m365 --all-targets --features fixture -D warnings is clean, and cargo fmt --check is clean.
  • Every guard was disabled once to confirm a test fails without it. The first round found three guards with no test pinning them; tests were added for them.
  • One guard could not be reached (the export-boundary clip), so it was removed rather than left unpinned.
  • The tests also caught two real issues during development:
    • @ inside bareword emails was wrongly refused.
    • The operation name project collided with the minted project concept 0x0101, so it was renamed to select_fields.

Dependency impact

ogar-loco is unchanged. The new crate pulls in ogar-auth for VerifiedLogin, and with it ogar-auth's crypto stack: 97 unique crates in the normal-dependency tree.

Next seam

PR-FLOW-02 wires ogar-az observations and the OGAR RBAC authority once the concepts are minted. PR-FLOW-03 adds the report-rs palette, built on compile for preview and run_flow with the session's VerifiedLogin. The crate README has the details.


Generated by Claude Code

…loco call ABI (PR-FLOW-01)

Adds a sibling crate that resolves friendly administrator labels
(Get-MgUser, Get-IamLicenseEvidence, Get-IamMembership, Where-Object,
Select-Object, Export-Report, and their aliases) to typed operations,
lowers an admitted read-only pipeline subset into one ogar-loco Quads
body, and runs it through the unchanged ogar-loco Interpreter under a
flow Dialect.

The actor is the canonical user of an ogar-auth VerifiedLogin; its scope
(tenant, capabilities, field mask, policy version) comes from an injected
ReportAuthority before anything runs. Mutating and code-executing labels
are known and refused; they have no call byte. A synthetic John Doe 101
fixture and falsifiers F1-F10 cover resolution, aliases, vocabulary
reuse, read-only enforcement, actor isolation, field projection,
determinism, parity with a direct typed reference, LOCO conformance and
unsupported syntax.

ogar-loco is not modified. No concept is minted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMM44PgMCtYoqx6XYnh
…re unpinned

Three disables came back green: the host-side field filter, tenant
scoping of host queries, and the leftover-stack check. Each guard is now
exercised directly: the population's loaded fields are inspected
mid-run, every host query is checked for the scoped tenant, and a
hand-built body that leaves a value on the stack is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMM44PgMCtYoqx6XYnh
… reach

The export clip filtered fields that no current operation can put in a
row (get_user projects at the source, attach checks the scope), so its
disable run stayed green. Removed rather than kept as an unpinned guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMM44PgMCtYoqx6XYnh
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 51235039-ba98-4985-9a1a-474571810a21
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review November 4, 2026 23:06
@AdaWorldAPI
AdaWorldAPI merged commit 83bfcd0 into main Nov 4, 2026
4 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T23:07:43.858414Z 96b303d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants